package polarizedMF;

import java.io.IOException;
import java.util.List;

import data.DataBig;
import data.MatrixSize;
import data.Param;
import file.Parsing3ClassesW2InputsBig;

public class Step8c_Ordinal_MeasurePercentage {

	double posPercent;
	double neuPercent;
	double negPercent;

	public Step8c_Ordinal_MeasurePercentage(String svm_dataset, String dataset,
			String fold, String epsilon, double margin, MatrixSize size,
			Param param) throws IOException {

		String svm_dir = svm_dataset + "fold-" + fold + "\\";
		String dir = dataset + "fold-" + fold + "\\";

		System.out.println("epsilon " + epsilon);
		System.out.println("margin " + margin);

		Parsing3ClassesW2InputsBig parseTest2 = new Parsing3ClassesW2InputsBig(
				dir + "smalltest0" + epsilon + "_data", svm_dir + "output0"
						+ epsilon + "", svm_dir + "output0" + epsilon + "_",
				margin);

		List<DataBig> test2 = parseTest2.getList();
		List<DataBig> postest2 = parseTest2.getPos();
		List<DataBig> negtest2 = parseTest2.getNeg();
		List<DataBig> neutest2 = parseTest2.getNeu();

		System.out.println("Pos test size: " + postest2.size());
		System.out.println("Neu test size: " + neutest2.size());
		System.out.println("Neg test size: " + negtest2.size());

		System.out.println("For svm-output signs ");

		posPercent = 100 * postest2.size() / (double) test2.size();
		neuPercent = 100 * neutest2.size() / (double) test2.size();
		negPercent = 100 * negtest2.size() / (double) test2.size();

		System.out.printf(
				"Percentage of Pos.Neu.Neg. Test set: %.1f / %.1f / %.1f\n",
				100 * postest2.size() / (double) test2.size(),
				100 * neutest2.size() / (double) test2.size(),
				100 * negtest2.size() / (double) test2.size());
	}

	public double getPosPercent() {
		return posPercent;
	}

	public double getNeuPercent() {
		return neuPercent;
	}

	public double getNegPercent() {
		return negPercent;
	}

}
